home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / pcmciautils.preinst < prev    next >
Text File  |  2007-10-23  |  835b  |  37 lines

  1. #! /bin/sh
  2. set -e
  3.  
  4. # Prepare to remove a no-longer used conffile
  5. prep_rm_conffile()
  6. {
  7.     CONFFILE="$1"
  8.  
  9.     if [ -e "$CONFFILE" ]; then
  10.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  11.         old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE '{s/ obsolete$//;s/.* //;p}}\" /var/lib/dpkg/status`"
  12.         if [ "$md5sum" != "$old_md5sum" ]; then
  13.             echo "Obsolete conffile $CONFFILE has been modified by you, renaming to .dpkg-bak"
  14.             mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
  15.         fi
  16.     fi
  17. }
  18.  
  19. case $1 in
  20.     install|upgrade)
  21.         if [ -z "$2" ] || \
  22.            dpkg --compare-versions "$2" lt 010-0ubuntu5; then
  23.             if [ -f /etc/default/pcmcia ]; then
  24.                 cp -a /etc/default/pcmcia \
  25.                       /etc/default/pcmciautils
  26.             fi
  27.         fi
  28.         if dpkg --compare-versions "$2" lt 010-0ubuntu8; then
  29.             prep_rm_conffile /etc/udev/pcmcia.rules
  30.         fi
  31.         ;;
  32. esac
  33.  
  34.  
  35.  
  36. exit 0
  37.